'use strict';

export default class extends think.controller.base {
  /**
   * some base method in here
   */
  async __before(){
      // 无需检查的 action
      let blankActions = ["login"];
      if(blankActions.indexOf(this.http.action)>=0){
          return;
      }

      //判断 session 里的 user
      let userInfo = await this.session("user");
      if(think.isEmpty(userInfo)){
          return this.display("login");
      }
  }
}